home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Invisible Universe
/
Invisible Universe (1995)(Voyager)[Mac-PC].iso
/
mac
/
MOVIES
/
MIAWS
/
_NAV.DIR
/
00003_Script_ setUpNavButtons
< prev
next >
Wrap
Text File
|
1995-11-13
|
6KB
|
274 lines
on setUpNavButtons
global gNavButtonList
-- if voidP(gNavButtonList) then
set gNavButtonList to [:]
-- shortNB 3,"closeButton" --QD box
-- shortNB 4,"titleBar" --QD box
-- shortNB 5,"views" --QD box
-- shortNB 6,"info" --QD box
-- shortNB 7,"hotspots" --QD box
-- shortNB 8,"photos" --QD box
-- shortNB 9,"hideAll" --QD box
-- sort gNavButtonList
-- end if
end setUpNavButtons
on shortNB c,s
global gNavButtonList
addprop gNavButtonList,c, birth(script "nb",c,s)
end
on closeButton
global gMouseDownTime
set gMouseDownTime = the ticks
tell the stage to hidePalette
lCloseNavPalette
end closeButton
on lOpenNavPalette
global gNavPalette, gFixPalObjNav, gNavOffScreen
global gUpdateNavPalette
--put ">>> lOpenNavPalette->gUpdateNavPalette" && gUpdateNavPalette
continue
if gUpdateNavPalette then exit
if not voidP(gFixPalObjNav) then gFixPalObjNav(mPatchIt)
updateStage
--put ">>> lOpenNavPalette->gNavOffScreen" && gNavOffScreen
if gNavOffScreen then
set gNavOffScreen = 0
open gNavPalette
set the rect of gNavPalette to offset(the rect of gNavPalette, 5000, -5000)
updateStage
end if
end lOpenNavPalette
on lCloseNavPalette alsoCloseGloss
global gNavPalette, gPalCloseTicks, gNavOffScreen
global gGlossPalette, gGlossOffScreen
if not gNavOffScreen then
set gNavOffScreen = 1
set the rect of gNavPalette to offset(the rect of gNavPalette, -5000, 5000)
set update = 1
else
set update = 0
end if
set glossClose = 0
if not voidP(gGlossPalette) then
if not voidP(alsoCloseGloss) and not gGlossOffScreen then
set gGlossOffScreen = 1
set the rect of gGlossPalette to offset(the rect of gGlossPalette, -5000, 5000)
set glossClose = 1
set update = 1
end if
end if
set gPalCloseTicks = the ticks
if update then tell the stage to updateStage
close gNavPalette
if glossClose then close gGlossPalette
pause
end lCloseNavPalette
on titleBar
global gNavPalette, gMV, gMH
put the mouseH into mH
put the mouseV into mV
repeat while the mouseDown
tell the stage to set gMH to the mouseH
tell the stage to set gMV to the mouseV
if gMH < 640 and gMH > 0 and gMV < 480 and gMV > 30 then
put the rect of gNavPalette into wRect
set the rect of gNavPalette to offset(wRect, the mouseH-mH, the mouseV-mV)
tell the stage to updateStage
end if
end repeat
CalculateStageSize
end titleBar
on views
--put ">>> views"
doViewPop
end views
on info
tell the stage to infoToggle
end info
on hotspots
tell the stage to toggleHotSpots
-- put ">>> hotspots"
end hotspots
on photos
--put ">>> photos pop up stub"
doPhotoPop
end photos
on hideAll
global gGlossPalette
--put ">>> hide All stub"
--set t = the ticks
-- beep
-- put ">>>1" && the ticks - t
lCloseNavPalette(1) -- tell it to close the glossary too!
-- beep
-- put ">>>2" && the ticks - t
--tell gGlossPalette to lCloseGlossPalette
tell the stage to hideAllButImage
-- beep
-- put ">>>3" && the ticks - t
end hideAll
on updatePalPopUps
global gNavPalette, gNavOffScreen
setUpView
setUpPhoto
tell the stage to setUpHotSpots
if gNavOffScreen then tell gNavPalette to lOpenNavPalette
end updatePalPopUps
on setUpPhoto
global gCurLabelList, gNavPalette, gCurLabelProp
if count(gCurLabelList) > 2 then
set lists = getAt(gCurLabelList, 3)
set photos = getAProp(lists, #PHOTOS)
end if
tell gNavPalette to setPhotosPopUp(photos)
end setUpPhoto
on setUpView
global gNavPalette, gCurLabelProp, gLabels
global gUpdateViewsMenuP --, gLastFrame
--put ">>>setUpView"
if not gUpdateViewsMenuP then exit
--set gLastFrame = -1
--put ">>>setUpView... updating"
--
--
-- Get the label list for the MAIN view, as this controls the views menu
--
set mainView = getMainView(string(gCurLabelProp))
--put ">>> mainView" && mainView
set MainLabelList = getAProp(gLabels, mainView)
if count(MainlabelList) > 2 then
set lists = getAt(MainLabelList, 3)
set views = getAProp(lists, #VIEWS)
end if
-- if count(gCurLabelList) > 2 then
-- set lists = getAt(gCurLabelList, 3)
-- set views = getAProp(lists, #VIEWS)
-- end if
if voidP(views) then
set byType = 1
else if (count(views) = 1) then
set byType = 1
else
set byType = 0
end if
if byType then
set s = char 5 of (string(gCurLabelProp))
-- set s = string(gCurLabelProp)
-- set s = char length(s) of s
tell gNavPalette to setView(views, s)
else
tell gNavPalette to setView(views)
end if
end setUpView
on getMainView label
global gNonVisibleSingles
if ((char 5 of label = "V") or (getOne(gNonVisibleSingles, char 1 to 5 of label) > 0)) then
return char 1 to 5 of label
else
return (char 1 to 4 of label) & "V"
end if
end getMainView
on openPopMenu
global gOpenPopMenu
set gOpenPopMenu = 1
--put ">>> openPopMenu"
if the machineType = 256 then
--
--
-- Make sure that the search path is used for this
-- (works for mac, but not for PC)
--
--openXLib "POPMENU.DLL"
else
--openXLib "PopUp Menu XObj"
openXLib "HierPopUp.XFCN"
end if
end openPopMenu
on rolloNew theLine
set command = item 3 of theLine & "rollo(" & item 4 of theLine & "," & item 5 of theLine & ")"
-- put command
do command
end rolloNew
on pressNew theLine
set command = item 3 of theLine & "press"
-- put command && quote & theLine & quote
do command && quote & theLine & quote
end
on doScriptNew theLine
set command = item 3 of theLine & "doScript"
-- put command && quote & theLine & quote
do command && quote & theLine & quote
end
on normNew theLine
set command = item 3 of theLine & "norm"
-- put ">>> normNew " & command && quote & theLine & quote
do command && quote & theLine & quote
end